import type { RouteRecordRaw } from 'vue-router'

export const backendBaseRoutePath = '/admin'
//有子路由的
const backendBaseRoute: RouteRecordRaw = {
    path: backendBaseRoutePath,
    name: 'admin',
    component: () => import('@/views/backend/Layout.vue'),
    redirect: `${backendBaseRoutePath}/home`,
    children: [
        {
            path: 'home',
            name: 'Home',
            component: () => import('@/views/backend/Home.vue'),
            meta: { title: '首页' }
        },
        {
            path: 'profile',
            name: 'Profile',
            component: () => import('@/views/backend/Profile.vue'),
            meta: { title: '个人资料' }
        },
        {
            path: 'settings',
            name: 'Settings',
            component: () => import('@/views/backend/Settings.vue'),
            meta: { title: '设置' }
        },
        {
            path: 'users',
            name: 'UserList',
            component: () => import('@/views/backend/UserList.vue'),
            meta: { title: '用户列表' }
        },
        {
            path: 'roles',
            name: 'Roles',
            component: () => import('@/views/backend/Roles.vue'),
            meta: { title: '角色管理' }
        },
        {
            path: 'permissions',
            name: 'Permissions',
            component: () => import('@/views/backend/Permission.vue'),
            meta: { title: '权限管理' }
        }
    ]
}

export default backendBaseRoute